<%--
  Created by IntelliJ IDEA.
  User: 康娜的小肥腿
  Date: 2020/3/25 0025
  Time: 15:44
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.student.dao.StudentDao" %>
<%@ page import="com.student.model.Student" %>
<%@ page import="java.util.List" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Integer empno = Integer.valueOf(request.getParameter("empno"));

    StudentDao employeeDao = new StudentDao();
    // 学生信息
    Student employee = new StudentDao().selectByPrimaryKey(empno);
    request.setAttribute("employee", employee);

%>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">修改学生信息</h4>
</div>
<form id="updateForm" class="form-horizontal" method="post">
    <div class="row clearfix">
        <div class="col-md-10 column col-lg-offset-1">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="form-group">
                        <label for="inputEmpno" class="col-sm-2 control-label">编号</label>
                        <div class="col-sm-10">
                            <input type="text" name="empno" class="form-control" id="inputEmpno" readonly value="${employee.empno}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEname" class="col-sm-2 control-label">姓名</label>
                        <div class="col-sm-10">
                            <input type="text" name="ename" class="form-control" id="inputEname" required value="${employee.ename}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputSno" class="col-sm-2 control-label">学号</label>
                        <div class="col-sm-10">
                            <input type="text" name="sno" class="form-control" id="inputSno" value="${employee.sno}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputSex" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10">
                            <input type="text" name="sex" class="form-control" id="inputSex" value="${employee.sex}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputSal" class="col-sm-2 control-label">民族</label>
                        <div class="col-sm-10">
                            <input type="text" id="inputSal" name="sal" class="form-control" value="${employee.sal}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputHiredate" class="col-sm-2 control-label">出生日期</label>
                        <div class="col-sm-10">
                            <input type="date" id="inputHiredate" name="hire_date" class="form-control" value="${employee.hiredate}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputPhone" class="col-sm-2 control-label">联系方式</label>
                        <div class="col-sm-10">
                            <input type="text" id="inputPhone" name="phone" class="form-control" value="${employee.phone}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputZy" class="col-sm-2 control-label">专业</label>
                        <div class="col-sm-10">
                            <input type="text" id="inputZy" name="zy" class="form-control" value="${employee.zy}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary" onclick="updateEmployee()">保存</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
    </div>
</form>